package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.ShoppingCart;
import com.ruoyi.system.domain.ShoppingCartDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ShoppingCartMapper extends BaseMapper<ShoppingCart> {

    List<ShoppingCartDto> getByUserId(Integer user_id);

    ShoppingCart getByUidPid(@Param("user_id") Integer user_id,
                             @Param("product_id") Integer product_id);

    int insert(ShoppingCart shoppingCart);

    Integer update(@Param("num") Integer num,
                   @Param("shoppingCartId") Integer shoppingCartId);

    Integer deleteByShoppingCartId(int id);

    ShoppingCart getByShoppingCartId(Integer shoppingCartId);

//    不是真正的删除
    Integer updateDelete(@Param("shoppingCartId") Integer shoppingCartId,
                         @Param("isexit")Integer isexit);

    //订单专用查询
    ShoppingCart getByShoppingCartId1(Integer shoppingCartId);
}
